let fp=new Vue({
    el:'#film-update',
    data:{
        film:JSON.parse(localStorage.getItem("currentUpdateFilm"))
    },
    methods:{
        update:function(){
            let formData={
                filmName:$("#filmname").val(),
                filmType:$("#filmtype").val(),
                filmCountry:$("#country option:selected").val(),
                filmDirector:$("#director").val(),
                filmLong:$("#filmlong").val(),
                filmLanguage:$("#language option:selected").val(),
                filmDate:$(".filmdate").val(),
                filmDesc:$("#desc").val(),
                filmPicture:$(".filmpicture").val(),
            }

            $.ajax({
                url:'http://localhost:8080/cinema/api/FilmUpdateServlet.do',
                type:'put',
                data:JSON.stringify(formData),
                dataType:'json',
                success:function(dto){
                    if(dto.code==200){
                        location.href="film_list.html";
                        
                    }else{
                        layer.msg(dto.msg,{icon:6});
                    }
                }
            });
        }
    }
});